#include<stdio.h>
#include<unistd.h>

int main()
{
    printf("start running……\n");
    int ret = fork();
    if(ret < 0)
    {
        printf("create child error!\n");
    }
    else if(ret == 0)//child
    {
        while(1)
        {
            printf("I an a child…  PID:%d, PPID:%d\n", getpid(), getppid());
            sleep(1);
        }
    }
    else//parent
    {
        while(1)
        {
            printf("I an a parent…  PID:%d, PPID:%d\n", getpid(), getppid());
            sleep(1);
        }
    }

    return 0;
}
